<extend name="template/base_index" />

<block name="area_header">
    <link rel="stylesheet" type="text/css" media="all" href="__CSS__/wxshop.css">
    <link type="text/css" rel="stylesheet" src="__CDN__/jquery-uploadify/3.2.1/uploadify.css" />
    <script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>
    <link type="text/css" rel="stylesheet" href="__CDN__/select2/3.5.2/select2.css" />
    <script type="text/javascript" src="__CDN__/select2/3.5.2/select2.min.js"></script>
    <script type="text/javascript" src="__CDN__/select2/3.5.2/select2_locale_zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="__CDN__/jquery-datetimepicker/jquery.datetimepicker.css">
    <script type="text/javascript" src="__CDN__/jquery-datetimepicker/jquery.datetimepicker.js"></script>
</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}
            <div class="col-main">
                <div class="main-hd">
                    <h2>发表主题帖</h2>
                </div>
                <div class="main-bd clearfix">
                    <form class="productForm form-horizontal" method="post">
                        <input type="hidden" name="pid" value="{$product.id}"/>
                        <input type="hidden" name="sku_id" value="{$sku_id}"/>
                        <h3><i>●</i>基本信息</h3>
                        <div class="form-group col-lg-12 col-md-12 clearfix">
                            <label for="" class="control-label col-lg-2 col-md-2">商品名称</label>
                            <div class="col-lg-10 col-md-10">
                                {$product.name}
                            </div>
                        </div>
                        <div class="form-group col-lg-12 col-md-12 clearfix">
                            <label for="" class="control-label col-lg-2 col-md-2">商品规格</label>
                            <div class="col-lg-10 col-md-10">
                                <volist name="sku" id="vo">
                                    {$vo.id.id_name}:{$vo.vid.vid_name}<br/>
                                </volist>
                            </div>
                        </div>
                        <div class="form-group col-lg-12 col-md-12 clearfix">
                            <label for="" class="control-label col-lg-2 col-md-2">现有库存</label>
                            <div class="col-lg-10 col-md-10">
                                {$product.quantity}
                            </div>
                        </div>
                        <div class="form-group col-lg-12 col-md-12 clearfix ">
                            <label for="" class="control-label col-lg-2 col-md-2 ">库存变动类型
                                <br/><span class="help-block"></span>
                            </label>
                            <div class="col-lg-10 col-md-10">
                                <select name="dtree_type" class="js_product_group">
                                    {:W("Partials/datatree",array(getDatatree('QUANTITY_TYPE'),true))}
                                </select>
                            </div>
                        </div>
                        <div class="form-group col-lg-12 col-md-12 clearfix ">
                            <label for="" class="control-label col-lg-2 col-md-2 ">库存变动时间
                                <br/><span class="help-block"></span>
                            </label>
                            <div class="col-lg-10 col-md-10">
                                <input type="text" name="change_time" class="change_time form-control input-normal input-sm" value="{:date('Y-m-d H:i:s')}"/>
                            </div>
                        </div>
                        <div class="form-group col-lg-12 col-md-12 clearfix">
                            <label for="" class="control-label col-lg-2 col-md-2">变动</label>
                            <div class="col-lg-10 col-md-10">
                                <input name="change" maxlength="60" class="form-control input-normal input-sm" />
                                <span class="help-block">正数代表入库，负数代表出库，不可为0</span>
                            </div>
                        </div>

                        <div class="form-group col-lg-12 col-md-12 clearfix">
                            <label for="synopsis" class="control-label col-md-2 col-lg-2 ">备注</label>
                            <div class="col-md-10 col-lg-10">
                                <textarea name="notes" class="form-control" rows="5"></textarea>
                                <div class="help-block">(您最多可以输入85个字)</div>
                            </div>
                        </div>

                        <div class="form-group col-lg-12 col-md-12 clearfix tool-bar text-center border">
                            <a target-form="productForm" href="{:U('Admin/Quantity/add')}"  class="ajax-post btn btn-primary" id="js_submit"><i class="fa fa-check"></i>确定</a>
                        </div>
                    </form>
                </div>
            </div>

            <include file="template/wxpicture" />
        </div>
        <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
</block>

<block name="area_footer">
    <script type="text/javascript" src="__JS__/product.js?v=__APP_VERSION__"></script>
    <script type="text/javascript">
        //初始化select2 控件
        function initSelect2(){
            $('select').select2();
        }

        $(function() {
            //图片上传
            wxuploadimg.init({cont:".wxuploaderimg"});

            initSelect2();

            $('.change_time').datetimepicker({
                lang: 'ch',
                format:'Y-m-d H:i:s',
                timepicker:true,
            });

        })

    </script>

</block>